package com.ins.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单表 实体类。
 *
 * @author ins
 * @since 2024-05-14
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table(value = "app_order")
public class AppOrder extends BaseEntity<AppOrder> implements Serializable {

    @Serial
    private static final long serialVersionUID = -3993599554553667658L;
    /**
     * 会员id
     */
    @Column(value = "user_id")
    private Long userId;

    /**
     * 优惠券id
     */
    @Column(value = "coupon_id")
    private Long couponId;

    /**
     * 订单编号
     */
    @Column(value = "order_no")
    private String orderNo;

    /**
     * 订单总金额
     */
    @Column(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 应付金额（实际支付金额）
     */
    @Column(value = "pay_amount")
    private BigDecimal payAmount;

    /**
     * 促销优化金额（促销价、满减、阶梯价）
     */
    @Column(value = "promotion_amount")
    private BigDecimal promotionAmount;

    /**
     * 积分抵扣金额
     */
    @Column(value = "integration_amount")
    private BigDecimal integrationAmount;

    /**
     * 优惠券抵扣金额
     */
    @Column(value = "coupon_amount")
    private BigDecimal couponAmount;

    /**
     * 管理员后台调整订单使用的折扣金额
     */
    @Column(value = "discount_amount")
    private BigDecimal discountAmount;

    /**
     * 支付方式：0->未支付；1->支付宝；2->微信
     */
    @Column(value = "pay_type")
    private Integer payType;

    /**
     * 订单来源：0->PC订单；1->app订单
     */
    @Column(value = "source_type")
    private Integer sourceType;

    /**
     * 订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单
     */
    @Column(value = "status")
    private Integer status;

    /**
     * 订单类型：0->正常订单；1->秒杀订单
     */
    @Column(value = "order_type")
    private Integer orderType;

    /**
     * 可以获得的积分
     */
    @Column(value = "integration")
    private Integer integration;

    /**
     * 可以活动的成长值
     */
    @Column(value = "growth")
    private Integer growth;

    /**
     * 活动信息
     */
    @Column(value = "promotion_info")
    private String promotionInfo;

    /**
     * 发票类型：0->不开发票；1->电子发票；2->纸质发票
     */
    @Column(value = "bill_type")
    private Integer billType;

    /**
     * 发票抬头
     */
    @Column(value = "bill_header")
    private String billHeader;

    /**
     * 发票内容
     */
    @Column(value = "bill_content")
    private String billContent;

    /**
     * 收票人电话
     */
    @Column(value = "bill_receiver_phone")
    private String billReceiverPhone;

    /**
     * 收票人邮箱
     */
    @Column(value = "bill_receiver_email")
    private String billReceiverEmail;

    /**
     * 订单备注
     */
    @Column(value = "remark")
    private String remark;

    /**
     * 下单时使用的积分
     */
    @Column(value = "use_integration")
    private Integer useIntegration;

    /**
     * 支付时间
     */
    @Column(value = "payment_time")
    private LocalDateTime paymentTime;

    /**
     * 发货时间
     */
    @Column(value = "delivery_time")
    private LocalDateTime deliveryTime;


}
